<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>响应式导航栏</title>
		<style>
			* {
				margin: 0;
				padding: 0;
			}
			body {
				list-style: none;
				box-sizing: border-box;
				font-family: montserrat;
			}
			a {
				text-decoration: none;
			}
			nav {
				position: relative;
				background: #0082e6;
				width: 100%;
			}
			.logo {
				/* float: left; */
				color: #fff;
				font-style: 35px;
				line-height: 80px;
				padding: 0 100px;
				font-weight: 700;
			}
			nav ul {
				float: right;
				margin-right: 20px;
			}
			nav ul li {
				display: inline-block;
				line-height: 80px;
				margin: 0 5px;
			}
			nav ul li a {
				padding: 7px 13px;
				border-radius: 3px;
				color: #fff;
				font-style: 17px;
				text-transform: uppercase;
			}
			.active,
			a:hover {
				background: #1b9bff;
				transition: 0.5s;
			}
			input {
				display: none;
				position: absolute;
				top: 20px;
				right: 20px;
				width: 40px;
				height: 40px;
				/* background: #000; */
				cursor: pointer;
				opacity: 0;
			}
			nav span {
				display: none;
				position: absolute;
				top: 25px;
				right: 25px;
				width: 25px;
				height: 5px;
				background: #fff;
				border-radius: 5px;
				pointer-events: none;
			}
			nav span:nth-child(3) {
				top: 35px;
			}
			nav span:nth-child(4) {
				top: 45px;
			}
			nav i {
				display: none;
				position: absolute;
				top: 35px;
				right: 25px;
				width: 25px;
				height: 5px;
				background: #fff;
				border-radius: 5px;
				pointer-events: none;
			}
			nav i:nth-child(5) {
				transform: rotate(-45deg);
			}
			nav i:nth-child(6) {
				transform: rotate(45deg);
			}
			@media (max-width: 952px) {
				.logo {
					font-size: 30p;
					padding-left: 50px;
				}
				nav ul li a {
					font-style: 16px;
				}
			}
			@media (max-width: 858px) {
				nav span,
				nav input {
					display: block;
				}
				ul {
					position: fixed;
					width: 100%;
					height: 100vh;
					background: #2c3e50;
					top: 80px;
					left: -100%;
					text-align: center;
					transition: all 0.5s;
				}
				nav ul li {
					display: block;
				}
				nav ul li a {
					font-size: 20px;
				}
				a:hover,
				.active {
					background: none;
					color: #0082e6;
				}
				#check:checked ~ ul {
					left: 0;
				}
				#check:checked ~ span {
					display: none;
				}
				#check:checked ~ i {
					display: block;
				}
			}
		</style>
	</head>
	<body>
		<nav>
			<input type="checkbox" id="check" />
			<span></span>
			<span></span>
			<span></span>
			<i></i>
			<i></i>
			<label class="logo">DesignX</label>
			<ul>
				<li><a href="javascript:void()" class="active">Home</a></li>
				<li><a href="javascript:void()">About</a></li>
				<li><a href="javascript:void()">Services</a></li>
				<li><a href="javascript:void()">Contact</a></li>
				<li><a href="javascript:void()">Feedback</a></li>
			</ul>
		</nav>
	</body>
</html>
